Repository navigation
feat(native): Add option to limit crash reports per group - #15798
Merged
Merged
Conversation
Member
Author
|
The migration is still missing. I'll add it momentarily. |
jan-auer
force-pushed
the
feat/native-limit-crashreports
branch
from
November 25, 2019 14:41
ad8c410 to
3c80aa9
Compare
untitaker
approved these changes
Nov 25, 2019
Member
Author
|
Adding @JTCunning for the Event attachment query. Note that we cache the limit once a group has exceeded it. So we only run this for the first events of each group. |
Member
Author
|
Offline review: Change to django cache. |
tonyo
suggested changes
Nov 25, 2019
tonyo
left a comment
Contributor
There was a problem hiding this comment.
As discussed internally, let's use memcached here.
Member
Author
|
@tonyo updated to Django cache. |
tonyo
approved these changes
Nov 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a feature to limit crash reports per issue group.
This extends the existing
sentry:store_crash_reportsoption to introduce a per-issue limit. The old option only toggled storage of crash reports on or off, the new one allows to set a limit. The new setting has three states:0disables storage of crash reports-1enables unbounded storage of crash reportsTruevalue is now shimmed to-1)To avoid database queries in every store request, we cache the number of crash reports per issue group once we've reached the limit. This also works with group merging and unmerging. Note that we do not prune the cache keys, since merging and unmerging does not invalidate the cache invariant.
This is inherently racy between our store workers. Therefore, the count is just a best-effort to limit the number overall, but might lead to slightly more crash reports than what's configured. The obvious exception is
0, where crash reports are not stored at all.New Settings UI
The old setting is applied automatically.
Migration
To run the count query efficiently, this requires
group_idto be set on event attachments. Unfortunately, this was not done in the past, which is why there is a migration in #15801.